export function toCollectionId(value: string | number | null | undefined): Result2<number> {
  if (value === null || value === undefined) {
    return { ok: false };
  }
  const id = typeof value === 'string' ? parseInt(value) : value;
  if (Number.isNaN(id)) {
    return { ok: false };
  }
  if (id < 1) {
    return { ok: false };
  }

  return { ok: true, result: id };
}
